package models

import (
	"errors"
)

func Status(name string) error {
	goods := GoodsJi{
		Name: name,
	}
	err := o.Read(&goods, "name")
	if err != nil {
		errors.New("技师不存在")
	}
	o.QueryTable("goodsJi").Filter("name", name).One(&goods)
	goods.Status = "服务中"
	_, err = o.Update(&goods)
	if err != nil {
		return errors.New("系统繁忙")
	}
	return nil
}
